package design_pattern.FactoryModel2;

import design_pattern.FactoryModel2.Factory.Factory;
import design_pattern.FactoryModel2.Factory.FactoryForA;
import design_pattern.FactoryModel2.Factory.FactoryForB;
import design_pattern.FactoryModel2.Product.Product;

/**
 * @Description
 * @Author yangshunjie
 * @Date 2021/9/20
 */
public class main {


    public static void main(String[] args) {
        Factory factory = new FactoryForB();
        //Product product = factoryForA.getProduct();
        Comsumer comsumer = new Comsumer(factory);
        Product product = comsumer.getProduct();
        //需要创建新的对象的时候，需要创建对应的工厂。



        System.out.println(product);
    }
}
